import moment from 'moment'
export const FIELD_CONFIG = [
  {
    label: '下单时间：',
    placeholder: '输入商品名称',
    prop: 'datetimes',
    type: 'daterange',
    pickerOptions: {
      shortcuts: [
        {
          text: '今天',
          onClick(picker) {
            const start = moment().startOf('day')
            const end = moment().endOf('day')
            picker.$emit('pick', [start.toDate(), end.toDate()])
          }
        },
        {
          text: '昨天',
          onClick(picker) {
            const end = moment()
              .subtract(1, 'days')
              .endOf('day')
            const start = moment(end).startOf('day')
            picker.$emit('pick', [start.toDate(), end.toDate()])
          }
        },
        {
          text: '最近一周',
          onClick(picker) {
            const end = moment().endOf('day')
            const start = moment(end)
              .subtract(6, 'days')
              .startOf('day')
            picker.$emit('pick', [start.toDate(), end.toDate()])
          }
        },
        {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date()
            const start = moment(end)
              .subtract(1, 'months')
              .toDate()
            picker.$emit('pick', [start, end])
          }
        },
        {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date()
            const start = moment(end)
              .subtract(3, 'months')
              .toDate()
            picker.$emit('pick', [start, end])
          }
        }
      ]
    }
  },
  {
    label: '付款方式：',
    placeholder: '输入选择付款方式',
    prop: 'paymode',
    type: 'select',
    multiple: true,
    data: [
      {
        value: 'wechat',
        label: '微信'
      },
      {
        value: 'alipay',
        label: '支付宝'
      },
      {
        value: 'credit',
        label: '积分'
      }
    ]
  },
  {
    label: '结算状态：',
    placeholder: '选择结算状态',
    prop: 'settle_status',
    type: 'select',
    data: [
      {
        value: true,
        label: '已结算'
      },
      {
        value: false,
        label: '未结算'
      }
    ]
  },
  {
    label: '营销类型：',
    placeholder: '选择营销类型',
    prop: 'promotion',
    type: 'select',
    data: [
      {
        value: 'seckill',
        label: '限时秒杀'
      },
      {
        value: 'timelimit',
        label: '限时折扣'
      },
      {
        value: 'special',
        label: '专题活动'
      },
      {
        value: 'grouon',
        label: '团购'
      }
    ]
  }
]
